import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from 'views/Home.vue'
import Welcome from 'components/Welcome.vue'
/* 线性表 */
import SequInsert from 'components/linearTable/sequentialTable/insert.vue'
import SequDelete from 'components/linearTable/sequentialTable/delete.vue'
import SequMerge from 'components/linearTable/sequentialTable/merge.vue'
import SequSearch from 'components/linearTable/sequentialTable/search.vue'
import LinkInsert from 'components/linearTable/linkedList/insert.vue'
import LinkDelete from 'components/linearTable/linkedList/delete.vue'
import LinkMerge from 'components/linearTable/linkedList/merge.vue'
import LinkSearch from 'components/linearTable/linkedList/search.vue'
/* 栈和队列 */
import Stack from 'components/StackAndQueue/Stack.vue'
import StackHand from 'components/StackAndQueue/StackByHand.vue'
import Queue from 'components/StackAndQueue/Queue.vue'
import QueueHand from 'components/StackAndQueue/QueueByHand.vue'
/* 树和二叉树 */
import TreeBuild from 'components/Tree/TreeBuild.vue'
import Proorder from 'components/Tree/Proorder.vue'
import Inorder from 'components/Tree/Inorder.vue'
import Postorder from 'components/Tree/Postorder.vue'
/* 排序 */
import BubbleSort from 'components/Sort/BubbleSort.vue'
import InsertSort from 'components/Sort/InsertSort.vue'
import SelectSort from 'components/Sort/SelectSort.vue'
import ShellSort from 'components/Sort/ShellSort.vue'
/* 查找 */
import OrderSearch from 'components/Search/OrderSearch.vue'
import BinarySearch from 'components/Search/BinarySearch.vue'
import InsertSearch from 'components/Search/InsertSearch.vue'
Vue.use(VueRouter)

const routes = [
  { path: '/', redirect: '/home' },
  {
    path: '/home',
    redirect: '/welcome',
    component: Home,
    children: [
      { path: '/bubbleSort', component: BubbleSort },
      { path: '/welcome', component: Welcome },
      { path: '/treeBuild', component: TreeBuild },
      { path: '/proorder', component: Proorder },
      { path: '/inorder', component: Inorder },
      { path: '/postorder', component: Postorder },
      { path: '/sequInsert', component: SequInsert },
      { path: '/sequDelete', component: SequDelete },
      { path: '/sequMerge', component: SequMerge },
      { path: '/sequSearch', component: SequSearch },
      { path: '/linkInsert', component: LinkInsert },
      { path: '/linkDelete', component: LinkDelete },
      { path: '/linkMerge', component: LinkMerge },
      { path: '/linkSearch', component: LinkSearch },
      { path: '/orderSearch', component: OrderSearch },
      { path: '/stack', component: Stack },
      { path: '/stackHand', component: StackHand },
      { path: '/queue', component: Queue },
      { path: '/queueHand', component: QueueHand },
      { path: '/binarySearch', component: BinarySearch },
      { path: '/insertSearch', component: InsertSearch },
      { path: '/insertSort', component: InsertSort },
      { path: '/selectSort', component: SelectSort },
      { path: '/shellSort', component: ShellSort }

    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
